FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY main.py .
COPY config.py .
COPY ocr_processor.py .
COPY video_processor.py .
COPY pre_post_processing.py .
COPY notebook_utils.py .

# Copy model and font files
COPY model/ ./model/
COPY fonts/ ./fonts/

# Expose port
EXPOSE 8000

# Run the application
CMD ["python", "main.py"]

